home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / utils / which5.zoo / readme < prev    next >
Text File  |  1992-07-06  |  1KB  |  38 lines

  1. Newsgroups: comp.sources.misc
  2. organization: VU Informatika, Amsterdam, The Netherlands
  3. subject: v11i096: which5
  4. From: maart@cs.vu.nl (Maarten Litmaath)
  5. Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  6.  
  7. Posting-number: Volume 11, Issue 96
  8. Submitted-by: maart@cs.vu.nl (Maarten Litmaath)
  9. Archive-name: which5/part01
  10.  
  11. There was still a small problem with which4.  :-(
  12. Thanks go to Jim Meyering <meyering@cs.utexas.edu>, who noted convert() will
  13. clobber the stack if the PATH is longer than BUF_SIZE - 1 characters.
  14. I've changed the use and implementation of convert() altogether: now it
  15. returns a path vector (cf. argv), whose components are the respective
  16. directories in the PATH.
  17. Furthermore I fixed the printing of the PATH: there are no trailing colons
  18. anymore.  Now you can do things like:
  19.  
  20.     for dir in `which`
  21.     do
  22.         set $dir/$pattern
  23.         test -f $1 || continue
  24.         for i
  25.         do
  26.             echo $i
  27.         done
  28.     done
  29.  
  30. ...to find all files in your PATH which match $pattern.
  31. However, beware of rewriting `which' in shell-script!  There were good
  32. reasons for making it a C program (check the source).
  33.  
  34. Thanks for your time,
  35.                 Maarten Litmaath @ VU Amsterdam:
  36.                 maart@cs.vu.nl, uunet!mcsun!botter!maart
  37.  
  38.